﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging;

namespace NET.Library.Errors.ExceptionHandling
{
    /// <summary>
    /// 
    /// </summary>
    public static class ExceptionPolicy 
    {
        ///----------------------------------------------------------------------------------
        /// <summary>
        /// 
        /// </summary>
        /// <param name="exceptionToHandle"></param>
        /// <param name="policyName"></param>
        /// <returns></returns>
        ///----------------------------------------------------------------------------------
        public static bool HandleException(Exception exceptionToHandle, string policyName)
        {
            return Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(exceptionToHandle, policyName);
        }

        ///----------------------------------------------------------------------------------
        /// <summary>
        /// 
        /// </summary>
        /// <param name="exceptionToHandle"></param>
        /// <param name="policyName"></param>
        /// <param name="exceptionToThrow"></param>
        /// <returns></returns>
        ///----------------------------------------------------------------------------------
        public static bool HandleException(Exception exceptionToHandle, string policyName, out Exception exceptionToThrow)
        {
            return Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(exceptionToHandle, policyName, out exceptionToThrow);
        }
    }
}
